from selenium import webdriver
import time
from selenium.webdriver.remote.webelement import WebElement
import tesseract

driver = webdriver.Chrome(executable_path="D:\chromedriver\chromedriver")
driver.get("https://movie.douban.com/explore#!type=movie&tag=%E7%83%AD%E9%97%A8&sort=recommend&page_limit=20&page_start=0")
time.sleep(1)
tag = driver.find_element_by_class_name("list")
for i in tag.find_elements_by_class_name('item'):
    m = i.find_element_by_tag_name('p')
    n = m.text
    x = n.split(' ')
    print(x)
# gg = driver.find_element_by_class_name("more")
# search = driver.find_element_by_name('search_text')
# search.send_keys('李连杰')
# search.submit()
# time.sleep(20)
# while True:
#     gg.click()
#     print(tag.text)
#     print('--' * 20)
    # print(gg.text)
# assert isinstance(tag, WebElement)
# for t in tag.find_elements_by_tag_name("tr"):
#     user_info = t.find_elements_by_tag_name("td")
#     username = user_info[0].text
#     age = user_info[1].text
#     gender = user_info[2].text
#
#     print(username, age, gender)

# print(type(tag))

# print(driver.title)
# time.sleep(10)
driver.quit()

